<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Hexo | VanKa</title><script src="https://cdn.bootcss.com/valine/1.4.4/Valine.min.js"></script><link rel="stylesheet" href="/vcb/css/arknights.css"><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/styles/atom-one-dark-reasonable.min.css"><style>@font-face {
 font-family: BenderLight;
 src: local('Bender'), url("/vcb/font/BenderLight.ttf");
}
@font-face {
 font-family: 'JetBrains Mono';
 src: local('JetBrains Mono'), url('/vcb/font/JetBrainsMono-Regular.woff2') format('woff2');
}</style><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/vcb/atom.xml" title="VanKa" type="application/atom+xml">
</head><body><header><nav><a href="/vcb/">Home</a><a href="/vcb/archives/">Archives</a></nav></header><main><article><div id="post-bg"><div id="post-title"><h1>Hexo</h1><hr></div><div id="post-content"><h1 id="Hexo"><a href="#Hexo" class="headerlink" title="Hexo"></a><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/">Hexo</a></h1><blockquote>
<p>快速、简洁且高效的博客框架</p>
</blockquote>
<h3 id="windos安装hexo"><a href="#windos安装hexo" class="headerlink" title="windos安装hexo"></a>windos安装hexo</h3><h4 id="cmd中安装"><a href="#cmd中安装" class="headerlink" title="cmd中安装"></a>cmd中安装</h4><blockquote>
<p>前置条件:需要安装好nodejs</p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-cli g</span><br></pre></td></tr></table></figure>

<h4 id="在git命令行中-初始化博客文件夹"><a href="#在git命令行中-初始化博客文件夹" class="headerlink" title="在git命令行中 初始化博客文件夹"></a>在git命令行中 初始化博客文件夹</h4><blockquote>
<p>前置条件:需要安装好git</p>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo init blog</span><br></pre></td></tr></table></figure>

<h4 id="切换到该路径"><a href="#切换到该路径" class="headerlink" title="切换到该路径"></a>切换到该路径</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> blog</span><br></pre></td></tr></table></figure>

<h4 id="安装hexo的扩展插件"><a href="#安装hexo的扩展插件" class="headerlink" title="安装hexo的扩展插件"></a>安装hexo的扩展插件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install</span><br></pre></td></tr></table></figure>

<h4 id="安装其它插件"><a href="#安装其它插件" class="headerlink" title="安装其它插件"></a>安装其它插件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-server --save</span><br><span class="line">$ npm install hexo-admin --save</span><br><span class="line">$ npm install hexo-generator-archive --save</span><br><span class="line">$ npm install hexo-generator-feed --save</span><br><span class="line">$ npm install hexo-generator-search --save</span><br><span class="line">$ npm install hexo-generator-tag --save</span><br><span class="line">$ npm install hexo-deployer-git --save</span><br><span class="line">$ npm install hexo-generator-sitemap --save</span><br></pre></td></tr></table></figure>



<h3 id="配置远程部署"><a href="#配置远程部署" class="headerlink" title="配置远程部署"></a>配置远程部署</h3><h4 id="修改域名"><a href="#修改域名" class="headerlink" title="修改域名"></a>修改域名</h4><p>在配置文件_config.yml中修改</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># URL</span></span><br><span class="line"><span class="comment">## Set your site url here. For example, if you use GitHub Page, set url as &#x27;https://username.github.io/project&#x27;</span></span><br><span class="line">url:  http://vankana.gitee.io/vcb</span><br></pre></td></tr></table></figure>

<h4 id="修改模板"><a href="#修改模板" class="headerlink" title="修改模板"></a>修改模板</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Extensions</span></span><br><span class="line"><span class="comment">## Plugins: https://hexo.io/plugins/</span></span><br><span class="line"><span class="comment">## Themes: https://hexo.io/themes/</span></span><br><span class="line">theme: butterfly <span class="comment">#hexo-theme-butterfly</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h4 id="修改远程部署地址"><a href="#修改远程部署地址" class="headerlink" title="修改远程部署地址"></a>修改远程部署地址</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Deployment</span></span><br><span class="line"><span class="comment">## Docs: https://hexo.io/docs/one-command-deployment</span></span><br><span class="line">deploy:</span><br><span class="line">  <span class="built_in">type</span>: git</span><br><span class="line">  <span class="comment"># repo: git@github.com:https://gitee.com/vankana/vcb.git</span></span><br><span class="line">  repository: https://gitee.com/vankana/vcb.git</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>



<h3 id="启动"><a href="#启动" class="headerlink" title="启动"></a>启动</h3><h4 id="生成静态页面"><a href="#生成静态页面" class="headerlink" title="生成静态页面"></a>生成静态页面</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<h4 id="开启本地服务器"><a href="#开启本地服务器" class="headerlink" title="开启本地服务器"></a>开启本地服务器</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo s</span><br></pre></td></tr></table></figure>
<p>地址：<a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000/</a></p>
<h5 id="若端口访问失败"><a href="#若端口访问失败" class="headerlink" title="若端口访问失败"></a>若端口访问失败</h5><p>使用Ctrl+C中断本地服务，使用命令<code>hexo s -p 5000</code>重新开启本地服务，访问<strong><a target="_blank" rel="noopener" href="http://localhost:5000/">http://localhost:5000/</a></strong></p>
<blockquote>
<p>可能是由于端口问题引起的</p>
</blockquote>
<h4 id="本地调试"><a href="#本地调试" class="headerlink" title="本地调试"></a>本地调试</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ hexo clean</span><br><span class="line">$ hexo g</span><br><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<h4 id="上传"><a href="#上传" class="headerlink" title="上传"></a>上传</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo d</span><br></pre></td></tr></table></figure>



<h3 id="操作"><a href="#操作" class="headerlink" title="操作"></a>操作</h3><h4 id="新增文章"><a href="#新增文章" class="headerlink" title="新增文章"></a>新增文章</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>

<p>详细: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h4 id="启动-1"><a href="#启动-1" class="headerlink" title="启动"></a>启动</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>详细: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h4 id="生成静态文件"><a href="#生成静态文件" class="headerlink" title="生成静态文件"></a>生成静态文件</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>详细: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h4 id="部署到远程站点"><a href="#部署到远程站点" class="headerlink" title="部署到远程站点"></a>部署到远程站点</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>详细: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>
<h3 id="扩展"><a href="#扩展" class="headerlink" title="扩展"></a>扩展</h3><h4 id="插入图片"><a href="#插入图片" class="headerlink" title="插入图片"></a>插入图片</h4><p>Hexo提供了很多内置标签，如插入<code>Vimeo</code>, <code>Youtube</code>, <code>Image</code>等</p>
<p>具体详情可查看: <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/tag-plugins">tag-plugins</a></p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><h4 id="文章"><a href="#文章" class="headerlink" title="文章"></a>文章</h4><ul>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_42477843/article/details/107165026">https://blog.csdn.net/qq_42477843/article/details/107165026</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/xuezhisdc/article/details/53130328">https://blog.csdn.net/xuezhisdc/article/details/53130328</a></li>
</ul>
<h4 id="网站"><a href="#网站" class="headerlink" title="网站"></a>网站</h4><ul>
<li><a target="_blank" rel="noopener" href="https://hexo.io/themes/">hexo主题</a><h4 id="推荐好看的主题"><a href="#推荐好看的主题" class="headerlink" title="推荐好看的主题"></a>推荐好看的主题</h4></li>
<li><a target="_blank" rel="noopener" href="https://github.com/fluid-dev/hexo-theme-fluid">Fluid</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/huweihuang/hexo-theme-huweihuang">A-Boy</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/miiiku/hexo-theme-flexblock">flex-block</a> (部署失败)</li>
<li><a target="_blank" rel="noopener" href="https://github.com/liuyib/hexo-theme-stun">stun</a> (部署失败)</li>
<li><a target="_blank" rel="noopener" href="https://github.com/volantis-x/community">volantis-x</a>(很棒 但是没有弄起)</li>
<li><a target="_blank" rel="noopener" href="https://github.com/Yue-plus/hexo-theme-arknights">hexo-theme-arknights</a>(很棒)</li>
</ul>
<div id="paginator"></div></div><div id="post-footer"><hr><a href="/vcb/2021/07/08/Spring%20Cloud%20Alibaba/">← Prev Spring Cloud Alibaba</a><hr></div><div id="bottom-btn"><a id="to-index" href="#post-index" title="index">≡</a><a id="to-top" href="#post-title" title="to top">∧</a></div><div id="Valine"></div><script>new Valine({
 el: '#Valine'
 , appId: ''
 , appKey: ''
 , placeholder: '此条评论委托企鹅物流发送'
})</script></div></article><aside><div id="about"><a href="/vcb/" id="logo"><img src="https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png" alt="Logo"></a><h1 id="Dr"><a href="/"> Dr.VanKa</a></h1><section id="total"><a id="total-archives" href="/vcb/archives"><span class="total-title">Archives Total:</span><span class="total-number">12</span></a><div id="total-tags"><span class="total-title">Tags:</span><span class="total-number">13</span></div><div id="total-categories"><span class="total-title">Categories:</span><span class="total-number">1</span></div></section></div><div id="aside-block"><h1>INDEX</h1><div id="post-index"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Hexo"><span class="toc-number">1.</span> <span class="toc-text">Hexo</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#windos%E5%AE%89%E8%A3%85hexo"><span class="toc-number">1.0.1.</span> <span class="toc-text">windos安装hexo</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#cmd%E4%B8%AD%E5%AE%89%E8%A3%85"><span class="toc-number">1.0.1.1.</span> <span class="toc-text">cmd中安装</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9C%A8git%E5%91%BD%E4%BB%A4%E8%A1%8C%E4%B8%AD-%E5%88%9D%E5%A7%8B%E5%8C%96%E5%8D%9A%E5%AE%A2%E6%96%87%E4%BB%B6%E5%A4%B9"><span class="toc-number">1.0.1.2.</span> <span class="toc-text">在git命令行中 初始化博客文件夹</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%87%E6%8D%A2%E5%88%B0%E8%AF%A5%E8%B7%AF%E5%BE%84"><span class="toc-number">1.0.1.3.</span> <span class="toc-text">切换到该路径</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85hexo%E7%9A%84%E6%89%A9%E5%B1%95%E6%8F%92%E4%BB%B6"><span class="toc-number">1.0.1.4.</span> <span class="toc-text">安装hexo的扩展插件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E5%85%B6%E5%AE%83%E6%8F%92%E4%BB%B6"><span class="toc-number">1.0.1.5.</span> <span class="toc-text">安装其它插件</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE%E8%BF%9C%E7%A8%8B%E9%83%A8%E7%BD%B2"><span class="toc-number">1.0.2.</span> <span class="toc-text">配置远程部署</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E5%9F%9F%E5%90%8D"><span class="toc-number">1.0.2.1.</span> <span class="toc-text">修改域名</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E6%A8%A1%E6%9D%BF"><span class="toc-number">1.0.2.2.</span> <span class="toc-text">修改模板</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9%E8%BF%9C%E7%A8%8B%E9%83%A8%E7%BD%B2%E5%9C%B0%E5%9D%80"><span class="toc-number">1.0.2.3.</span> <span class="toc-text">修改远程部署地址</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8"><span class="toc-number">1.0.3.</span> <span class="toc-text">启动</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2"><span class="toc-number">1.0.3.1.</span> <span class="toc-text">生成静态页面</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%BC%80%E5%90%AF%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-number">1.0.3.2.</span> <span class="toc-text">开启本地服务器</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%8B%A5%E7%AB%AF%E5%8F%A3%E8%AE%BF%E9%97%AE%E5%A4%B1%E8%B4%A5"><span class="toc-number">1.0.3.2.1.</span> <span class="toc-text">若端口访问失败</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E8%B0%83%E8%AF%95"><span class="toc-number">1.0.3.3.</span> <span class="toc-text">本地调试</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%8A%E4%BC%A0"><span class="toc-number">1.0.3.4.</span> <span class="toc-text">上传</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%93%8D%E4%BD%9C"><span class="toc-number">1.0.4.</span> <span class="toc-text">操作</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%B0%E5%A2%9E%E6%96%87%E7%AB%A0"><span class="toc-number">1.0.4.1.</span> <span class="toc-text">新增文章</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8-1"><span class="toc-number">1.0.4.2.</span> <span class="toc-text">启动</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6"><span class="toc-number">1.0.4.3.</span> <span class="toc-text">生成静态文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E5%88%B0%E8%BF%9C%E7%A8%8B%E7%AB%99%E7%82%B9"><span class="toc-number">1.0.4.4.</span> <span class="toc-text">部署到远程站点</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%A9%E5%B1%95"><span class="toc-number">1.0.5.</span> <span class="toc-text">扩展</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8F%92%E5%85%A5%E5%9B%BE%E7%89%87"><span class="toc-number">1.0.5.1.</span> <span class="toc-text">插入图片</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-number">1.0.6.</span> <span class="toc-text">参考资料</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%87%E7%AB%A0"><span class="toc-number">1.0.6.1.</span> <span class="toc-text">文章</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BD%91%E7%AB%99"><span class="toc-number">1.0.6.2.</span> <span class="toc-text">网站</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E5%A5%BD%E7%9C%8B%E7%9A%84%E4%B8%BB%E9%A2%98"><span class="toc-number">1.0.6.3.</span> <span class="toc-text">推荐好看的主题</span></a></li></ol></li></ol></li></ol></li></ol></div></div><footer><nobr><span class="text-title">©</span><span class="text-content">1970 to 2020</span></nobr><wbr><nobr><span class="text-title">ICP</span><span class="text-content">——备案号——</span></nobr><wbr><wbr><nobr>published with&nbsp;<a target="_blank" rel="noopener" href="http://hexo.io">Hexo&nbsp;</a></nobr><wbr><nobr>Theme&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus/hexo-theme-arknights">Arknight&nbsp;</a></nobr><wbr><nobr>by&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus">Yue_plus</a></nobr></footer></aside></main><canvas id="canvas-dust"></canvas><script src="/vcb/js/arknights.js"></script><script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/highlight.min.js"></script></body></html>